<link rel="stylesheet" type="text/css" href="{$smarty.const.URL_BASE}/modules/abbannermodule/css/abbannermodule.css" />
{if $in_admin_mode == 1}
<div class="abbannermodule" style="width: {$config->mwidth}px; height: {$config->mheight}px;">
	<ul class="default">
		<li class="manage"><a class="tip" title="Quản lý tài nguyên" href="{link action=list module=abbannermodule}">Quản lý tài nguyên</a></li>
		<li class="configure"><a class="tip" title="Cấu hình hiển thị module này" href="{link action=configure _common=1}">Cấu hình module</a></li>
	</ul>
</div>
{elseif $item != 0}
	{if $config->show_type == 0}
		{* For text *}
		<div class="abbannermodule" style="width: {$config->mwidth}px; height: {$config->mheight}px;">
			{$item->text_value}
		</div>
	{elseif $config->show_type == 1}
		{if $config->rotator == 6}
			{* Two Banners image *}
			<div>
				{foreach from=$item item=link}
				<a href="{$link->img_linkurl}" title="{$link->title}" >  
					<img src="{$smarty.const.BASE_URL}/phpThumb.php?src={$link->img_path}&w={$rotator_6_width}" width="{$rotator_6_width}px" height="{$rotator_6_height}px" title="{$link->title}">
				</a>
				{/foreach}
				<div class="clear">
			</div>
		{else}{* For every show type other than Two Banners image *}
			{* For img *}
		<link rel="stylesheet" type="text/css" href="{$smarty.const.URL_BASE}/modules/abbannermodule/nivoslider/nivo.css" />
		<script src="{$smarty.const.URL_BASE}/modules/abbannermodule/nivoslider/jquery.nivo.slider.pack.js" type="text/javascript"></script>
		<div class="abbannermodule" style="width: {$config->mwidth}px; height: {$config->mheight}px;">
			<div id="slider" class="nivoSlider">
			{foreach from=$item item=link}
				<a href="{$link->img_linkurl}" title="{$link->title}" >  
					<img src="{$smarty.const.BASE_URL}/phpThumb.php?src={$link->img_path}&w={$config->mwidth}" width="{$config->mwidth}px" height="{$config->mheight}px" title="{$link->title}">
				</a>
			{/foreach}
			</div>
		</div>
		{literal}
			<script type="text/javascript">
				jQuery(window).load(function() {
					jQuery('#slider').nivoSlider({
						animSpeed:800,
						controlNav: false
					});
				});
			</script>
			<style>
				#slider a img, #slider, #slider-wrapper{
					width: {/literal}{$config->mwidth}{literal}px;
					height: {/literal}{$config->mheight}{literal}px;
				}
			</style>
		{/literal}
		{/if}
	{elseif $config->show_type == 2}
		{* For flash *}
		<a href="{$item->flash_linkurl}">
		<embed height="{$config->mheight}" width="{$config->mwidth}" allowscriptaccess="always" wmode="transparent" loop="true" play="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  src="{$item->flash_path}">
		</a>
	{/if}
{/if}